package org.aeon.gamechatnest.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serial;
import java.io.Serializable;

/**
 * 私信聊天实体类（个人之间）
 *
 * @author : Qik 2024/5/7 19:33
 */
@Data
@Document
@Schema(description = "聊天消息实体类", name = "ChatMessage")
public class ChatMessage implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 消息id（雪花算法生成）
     */
    @Id
    @Schema(description = "消息id", name = "id")
    private String id;
    /**
     * 目标对话id
     */
    @Schema(description = "目标对话id", name = "targetId")
    private Long targetId;

//    /**
//     * 接收用户
//     */
//    @Schema(description = "接收用户", name = "toUser")
//    private Long toUser;
    /**
     * 发送用户
     */
    @Schema(description = "发送用户", name = "fromUser")
    private Long fromUser;
    /**
     * 信息内容
     */
    @Schema(description = "信息内容", name = "content")
    private String content;
    /**
     * 回复信息id
     */
    @Schema(description = "回复信息id", name = "reply")
    private String reply;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间", name = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Long createTime;

    /**
     * 是否删除（0：正常，1：删除）
     */
    @Schema(description = "逻辑删除", name = "isDelete", hidden = true)
    private Integer isDelete;
}
